<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/Admin/css/style.css" />
	<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/js/menu.js"></script>
	<style type="text/css">
		table{
			width: 100%;
			margin-left: auto;
			text-align: center;
			margin-right: auto;
		}
		table th{
			background-color: #11B6B6;
			color: white;
			font-family: "微软雅黑";
		}
	</style>
</head>
<body>
	<div class="right-nav">
		<ul>
			<li><img src="__PUBLIC__/Admin/images/home.png"></li>
				<li style="margin-left:25px;">您当前的位置：</li>
				<li><a href="__MODULE__/Message/index">评论管理</a></li>
				<!-- <li>></li>
				<li><a href="#">最新公告</a></li> -->
		</ul>
	</div>
	<form action="__URL__/index" method="post">
		共有<span style="color: red;">{$limits.num}</span>条评论<span> | 筛选　</span>
		<label><input name="is_varify" type="checkbox" value="1" <?php echo isset($limits['is_varify'])?'checked':'' ?> />审核　</label> 
		<label><input name="user_id" type="checkbox" value="0" <?php echo $limits1==1?'':'checked' ?> />游客　</label> 
		<lable>留言时间：<input type="date" name="mes_createtime1" value="<?php 
			if(isset($limits['mes_createtime'])){
				if(is_array($limits['mes_createtime'][0])) {
					echo date('Y-m-d',$limits['mes_createtime'][0][1]);
				}else if($limits['mes_createtime'][0]=='gt'){
					echo date('Y-m-d',$limits['mes_createtime'][1]);
				}
			}
		?>"> -- <input type="date" name="mes_createtime2" value="<?php 
			if(isset($limits['mes_createtime'])){
				if(is_array($limits['mes_createtime'][0])) {
					echo date('Y-m-d',$limits['mes_createtime'][1][1]-86400);
				}else if($limits['mes_createtime'][0]=='lt'){
					echo date('Y-m-d',$limits['mes_createtime'][1]-86400);
				}
			}
		?>"></lable>
	
		<input type="submit" value=" 搜索 " class="button">
	</form>
	<table  id="tab">
		<tr>
			<th>信息id</th>
			<th>留言人</th>
			<th>内容</th>
			<th>审核</th>
			<th>留言时间</th>
			<th colspan="3">操作</th>
		</tr>
		<foreach name="messages" item="message">
			<tr>
				<td>{$message.info_id}</td>
				<td>{$message['user_name']?$message['user_name']:'游客'}</td>
				<td>{$message.mes_content}</td>
				<td><img src="__PUBLIC__/Admin/images/{$message['is_varify']?'yes':'no'}.gif" alt=""></td>
				<td>{$message.mes_createtime}</td>
				<td><a href="__URL__/varify/p/{$p}/mes_id/{$message.mes_id}" name="varify">审核</a></td>
				<td><a href="__URL__/edit/mes_id/{$message.mes_id}">详细</a></td>
				<td><a href="__URL__/delete/mes_id/{$message.mes_id}" onclick="JavaScript: return confirm('你确定要删除吗?')">删除</a></td>
			</tr>
		</foreach>
		<tr><td colspan="9">{$pageinfo}</td></tr>
	</table>
</body>
</html>
<script>
	$("tr:last-child a").click(function(){
		var url=$(this).attr('href');
		$(this).attr('href','javascript:void(0);');
		$("form").attr('action',url).submit();
	});
</script>

<script>
	$("a[name='varify']").click(function(){
		var url=$(this).attr('href');
		$(this).attr('href','javascript:void(0);');
		$("form").attr('action',url).submit();
	});
	//console.log($("a[name='varify']"));
</script>